<?php
require_once("connect_db.php");
//

$sqlUpdate="update meeting set meet_remark='".$_POST["meet_remark"]."',meet_status='Y'
			where meet_id='".$_POST["temp"]."' ";
	$queryUpdate=mysql_query($sqlUpdate);
$sqlO="select order_id,hour_num from course,orders,meeting where orders.course_id=course.course_id and meeting.order_id=order.order_id and meet_id='".$_POST["temp"]."'";
$queryO=mysql_query($sqlO);
$resultO=mysql_fetch_array($queryO);
$sqlCount="select sum(meet_hour) as meetC from meeting where meet_status='Y' and order_id='".$resultO["order_id"]."'";
$queryCount=mysql_query($sqlCount);
$resultCount=mysql_fetch_array($queryCount);
$sum=$resultO["hour_num"]-$resultCount["meetC"];
if($sum==0){
$sqlUpdateO="update orders set order_status='C'
			where order_id='".$resultO["order_id"]."' ";
	$queryUpdateO=mysql_query($sqlUpdateO);
}
?>